/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;
import java.io.*;
import java.util.*;
import net.*;

/**
 *
 * @author antonio
 */
public class ReaderPointsFile {

    private String point;
    private Vector apPoint;

    public ReaderPointsFile(String point)
    {
        this.point = point;
        this.apPoint = new Vector();
    }

    public Vector read()
    {
        try{

            BufferedReader file = new BufferedReader(new FileReader("E:\\Documents and Settings\\antonio\\Documenti\\teststanza\\" + this.point + ".txt"));

            while(true)
            {
                String line = file.readLine();
                if(line == null)
                {
                    break;
                }
                else
                {
                    AccessPoint ap = new AccessPoint();
                    ap.setMac(line);

                    String signal = file.readLine();
                    ap.setSignal(signal);

                    String total = file.readLine();
                    ap.setTotalSignal(total);

                    this.apPoint.add(ap);
                }
            }
        }catch(Exception e )
        {
            e.printStackTrace();
        }

        return this.apPoint;
    }
}
